package com.jin.工厂模式.简单工厂模式.顺从.service.Impl;

import com.jin.工厂模式.简单工厂模式.违背.card.IQiYiCardService;
import com.jin.工厂模式.简单工厂模式.顺从.service.ICommodity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class CardCommodityService implements ICommodity {
    private Logger logger = LoggerFactory.getLogger(CardCommodityService.class);
    private IQiYiCardService iQiYiCardService = new IQiYiCardService();
    @Override
    public void sendCommodity(String uid, String commodityId, String bizId, Map<String, String> extMap) throws Exception {
        String mobile = queryUserPhoneNumber(uid);
        iQiYiCardService.grantToken(mobile,bizId);
        logger.info("请求参数爱奇艺兑换卡=>uid:{} commodityId:{} bizId:{} exMap:{} ",uid,commodityId,bizId,extMap);
        logger.info("测试结果爱奇艺兑换卡:success");
    }
    private String queryUserPhoneNumber(String uId) {
        return "15200101232";
    }
}
